﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Suspiros_Persistencia;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;

namespace SuspirosWeb
{
    public partial class Formulario_web121 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection("Data Source=localhost;Initial Catalog=suspirosdb;Persist Security Info=True;User ID=sa;Password=itson");
            dsProductos ds = new dsProductos();
            string sql = "SELECT        id, imagen, nombre, descripcion, precio, stock, catalogo FROM dbo.productos;";
            SqlDataAdapter adapter = new SqlDataAdapter(sql, con);
            adapter.Fill(ds.productosview);
            RPTProductos rpt = new RPTProductos();
            rpt.SetDataSource(ds);

            CrystalReportViewer1.ReportSource = rpt;
        }
    }
}